import http from "@/common/http/index.js";

// 根据 token 获取用户信息
function getInfo() {
    return http.get("/personal/getInfo")
}

//更新用户信息
function updateUser(user_name,phone,email,address) {
    let data = {
        user_name: user_name,
        phone: phone,
        email: email,
        address: address,
    };
    return http.post("personal/updateUser",data)
}

//上传用户头像
function updateAvatar(params) {
    return http.upload("personal/updateAvatar", params);
}

export default {
    getInfo,
    updateUser,
    updateAvatar,
}